package cn.template.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;

import cn.template.entity.PageResult;
import cn.template.mapper.UserMapper;
import cn.template.pojo.User;
import cn.template.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;

	@Override
	public PageResult getUsers(int page, int size) {
		PageHelper.startPage(page, size);
		List<User> list = userMapper.selectByExample(null);
		return new PageResult(list.size(), list);
	}
}